<template>
  <div class="input_big_box">
    <div class="title_box">
      <div class="title">{{ title || $t('page4.doc82') }}</div>
    </div>
    <div class="inp_content_box" >
      <!--手机号的区号-->
      <div class="phone_code" @click="selectAreaId">
        <span>+{{ areaId }}</span>
        <van-icon name="arrow-down" class="arrow" />
      </div>
      <div class="input">
        <input
          v-model="inpValue"
          :placeholder="placeholder || $t('page.doc35')"
          :disabled="disabled"
        />
      </div>
    </div>
    <keep-alive>
      <AreaPopup v-model="showArea" :areaId.sync="areaCode" />
    </keep-alive>
  </div>
</template>

<script>
import input_mixins from './input_mixins';
import AreaPopup from '@/components/input/AreaPopup.vue';

export default {
  components: { AreaPopup },
  mixins: [input_mixins],
  props: {
    areaId: [Number, String],
    isNumber:{
      type: Boolean,
      default: true
    }
  },
  data() {
    return {
      showArea: false,
    };
  },
  methods: {
    selectAreaId() {
      this.showArea = true;
    },
  },
  computed: {
    areaCode: {
      get() {
        return this.areaId;
      },
      set(value) {
        this.$emit('update:areaId', value);
      },
    },
  },
};
</script>

<style lang="less" scoped>
@import './index';

.phone_code {
  color: #fff;
  font-size: 0.28rem;
  display: flex;
  align-items: center;
  margin-right: .12rem;
  .arrow{
    margin-left: .06rem;
  }
}
</style>
